import React, { ReactNode, useEffect } from "react";
import { useLocation, useNavigate } from "react-router-dom";
interface RouteGuardProps {
    children: ReactNode
}

const RouteGuard: React.FC<RouteGuardProps> = ({children}) => {

    const location = useLocation()
    const navigate = useNavigate()

    useEffect(()=>{
        const pathname = location.pathname
        console.log(pathname)
    },[location.pathname,navigate])
    return (<>{children}</>)
}
export default RouteGuard